package com.surfilter.mq.threadman;

import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;

public class ThreadManage implements ThreadManager{

	private ScheduledExecutorService htread;
	
	public ThreadManage(int threadNum){
		initThreadManage(threadNum);
	}
	
	/**
	 * 
	 * @param threadNum
	 * @return 
	 * @return
	 */
	private void initThreadManage(int threadNum){
		htread = Executors.newScheduledThreadPool(threadNum);
	}
	
	public void executes(List<Runnable> runnables){
		for(Runnable run : runnables){
			execute(run);
		}
	}

	public ScheduledExecutorService getHtread() {
		return htread;
	}

	public void setHtread(ScheduledExecutorService htread) {
		this.htread = htread;
	}
	
	@Override
	public void remove(String thread_name) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void execute(Runnable runnable) {
		// TODO Auto-generated method stub
		htread.execute(runnable);
	}

	@Override
	public int getThreadNum() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int getThread_num() {
		// TODO Auto-generated method stub
		return 0;
	}
	
}
